<?php
header('content-type:text/html; charset=utf-8');
$id=$_REQUEST["id"];
echo $id;

$pdo=new PDO('mysql:dbname=mydb3;charset=utf8','root');
$star=$pdo->prepare('select * from user where id=:id');
$star->execute(array('id'=>$id));
$data=$star->fetchAll(PDO::FETCH_NAMED);
var_dump($data);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head></head>
	<body>
		<form action="bianji2" method="post">
			<table border="1" align="center">
				<tr align="center">
					<th colspan="4">编辑</th>
				</tr>
				<?php for($i=0;$i<count($data);$i++){?>
				<tr>
					<td width="150"><input value="<?php echo $data[$i]['id'];?>" name="id"/></td>
					<td width="150"><input value="<?php echo $data[$i]['name'];?>" name="name"/></td>
					<td width="150"><input value="<?php echo $data[$i]['qq'];?>" name="qq"/></td>
					<td width="150"><input value="<?php echo $data[$i]['phone'];?>" name="phone"></input></td>
				</tr>
				<?php }?>
				<tr>
					<td><button type="submit">确定</button></td>
				</tr>
			</table>
		</form>
	</body>
</html>